package com.igroupes.ovineherd.model;

import lombok.Data;

import java.util.List;

@Data
public class RelGetRequestWhereNode {
    private ConnRelation conjunction; // and / or
    private List<FieldWithValue> children;


    public enum ConnRelation {
        AND, OR;
    }

    public enum OpType{
        EQUAL,
        NOT_EQUAL,
        IS_EMPTY,
        IS_NOT_EMPTY,
        LIKE,
        NOT_LIKE,
        STARTS_WITH,
        ENDS_WITH,
        LESS,
        LESS_OR_EQUAL,
        GREATER,
        GREATER_OR_EQUAL,
        BETWEEN,
        NOT_BETWEEN
        ;
    }

    @Data
    public static class FieldWithValue {
        private String fieldName;
        private boolean isStr;
        private Object right;
        private OpType op;
        private ConnRelation conjunction;
        private List<FieldWithValue> children;
    }

}
